﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MethodWorx.CMS.Plugins;
using MethodWorx.CMS.Workflow.CreateContentItem;
using MethodWorx.CMS.Workflow.IfEquals;
using MethodWorx.CMS.Workflow.IfValid;
using MethodWorx.CMS.Workflow.PublishContentItem;
using MethodWorx.CMS.Workflow.Validate;
using MethodWorx.CMS.Workflow.SetContentItemProperty;
using MethodWorx.CMS.Workflow.RefreshCurrentPage;
using MethodWorx.CMS.Workflow.RedirectTo;
using MethodWorx.CMS.Workflow.CreateMember;
using MethodWorx.CMS.Workflow.IfContainsData;
using MethodWorx.CMS.Workflow.SetAttribute;
using MethodWorx.CMS.Workflow.CreatePage;
using MethodWorx.CMS.Workflow.SetPageProperty;
using MethodWorx.CMS.Workflow.PublishPage;
using MethodWorx.CMS.Workflow.SendEmail;

namespace MethodWorx.CMS.Workflow
{
    [CmsPlugin(Name = "Built In Workflow Components", Description = "Provides the built in workflow components for the CMS", Id = "{AD978E6A-3BF4-41D0-AFFD-4AD1FA2BD8DD}")]
    public class BuiltInWorkflowComponents : Plugin, IWorkflowPlugin, IAutoLoadedPlugin
    {
        private List<IWorkflowComponent> components = new List<IWorkflowComponent>();

        public BuiltInWorkflowComponents()
        {
            components.Add(new IfValidWorkflowComponent(this));
            components.Add(new CreateContentItemWorkflowComponent(this));
            components.Add(new PublishContentItemWorkflowComponent(this));
            components.Add(new SetContentItemPropertyWorkflowComponent(this));
            components.Add(new ValidateWorkflowComponent(this));
            components.Add(new RefreshCurrentPageWorkflowComponent(this));
            components.Add(new RedirectToWorkflowComponent(this));
            components.Add(new CreateMemberWorkflowComponent(this));
            components.Add(new IfContainsDataWorkflowComponent(this));
            components.Add(new  IfEqualsWorkflowComponent(this));
            components.Add(new SetAttributeWorkflowComponent(this));
            components.Add(new CreatePageWorkflowComponent(this));
            components.Add(new SetPagePropertyWorkflowComponent(this));
            components.Add(new PublishPageWorkflowComponent(this));
            components.Add(new SendEmailWorkflowComponent(this));
        }

        #region IWorkflowPlugin Members

        public IEnumerable<IWorkflowComponent> GetWorkflowComponents()
        {
            return components;
        }

        #endregion
    }
}
